<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>demo-tooltip-</title>
	<!-- Include the FontAwesome CSS if you want to use feedback icons provided by FontAwesome -->
    <link rel="stylesheet" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css" />
	<!-- <link rel="stylesheet" href="/vendor/bootstrap/css/bootstrap.css"/> -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/css/admin.css">
    <link rel="stylesheet" type="text/css" href="/dist/css/formValidation.css">
    <!--[if IE]>
        <script src="http://libs.baidu.com/html5shiv/3.7/html5shiv.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="container">
        <div class="row">
            <div class="col-md-2">
            </div>
            <div class="col-md-10">
            @if (session('msg'))
				 <div class="alert {{(session('code')==200)?'alert-success':'alert-danger'}} alert-dismissible fade in" role="alert">
				    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				    {{ session('msg') }}
				 </div>
			@endif

            @if (count($errors) > 0)
                <div class="alert alert-danger">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <ul>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif
                <form id="defaultForm" method="post" action="/admin/web">
                        {!! csrf_field() !!}
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">新增商品(form表单提交)</h3>
                            </div>
                            <div class="panel-body">
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label for="name">firstName</label>
                                            <input type="text" class="form-control" name="firstName" value="{{old('firstName')}}" placeholder="firstName">
                                        </div>
                                    </div>
                                     <div class="col-md-12">
                                        <div class="form-group">
                                            <label for="name">lastName</label>
                                            <input type="text" class="form-control" name="lastName" value="{{old('lastName')}}" placeholder="lastName">
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                         <div class="form-group" style="text-align: center;">
										     <button type="submit" class="btn btn-primary">保存</button>
                         <a href="javascript:history.back();" class="btn btn-default">返回</a>
										</div>
									</div>
                                </div>
                        </div>
                 </form>
            </div>
        </div>
    </div>
 <script src="https://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.1/js/bootstrap.js"></script>
<script type="text/javascript" src="/dist/js/formValidation.js"></script>
<script type="text/javascript" src="/dist/js/framework/bootstrap.js"></script>
<script type="text/javascript" src="/dist/js/language/zh_CN.js"></script>
<script type="text/javascript">
        $(document).ready(function() {
            $('#defaultForm').formValidation({
                err: {
                    container: 'tooltip'
                },
        //        trigger: 'blur',
                icon: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {
                    firstName: {
                        validators: {
                            stringLength: {
                                enabled: false,
                                min: 4,
                                message: 'The first name must be more than 5 characters'
                            },
                            notEmpty: {
                                message: 'The first name is required'
                            },
                            regexp: {
                                enabled: true,
                                regexp: /^[a-z]+$/i,
                                message: 'The first name must consist of a-z, A-Z characters only'
                            }
                        }
                    },
                    lastName: {
                        validators: {
                            stringLength: {
                                min: 4,
                                message: 'The last name must be more than 5 characters'
                            },
                            notEmpty: {
                                message: 'The last name is required'
                            },
                            regexp: {
                                regexp: /^[a-z]+$/i,
                                message: 'The last name must consist of a-z, A-Z characters only'
                            }
                        }
                    }
                }
            });
        });
    </script>
</body>
</html>